package com.example.service.webhook.business.carrier.repository;

import javax.annotation.Resource;

import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.example.service.webhook.business.carrier.entity.FamilyMemberEntity;
import com.example.service.webhook.business.carrier.entity.MobileBasicEntity;
import com.example.service.webhook.business.carrier.entity.MobileRechargeEntity;
import com.example.service.webhook.business.carrier.entity.MobileSmsEntity;
import com.example.service.webhook.business.carrier.entity.MobileVoiceCallEntity;
import com.example.service.webhook.business.carrier.entity.PackageUsageEntity;
import com.example.service.webhook.repository.base.BaseDAO;
import com.example.service.webhook.util.DateUtil;
/**
 * 运营商套餐适用情况
 * ClassName: PackageUsageRepository
 * date: 2016年7月19日 下午6:29:23   
 * @author yuandong  
 * @version   
 * @since JDK 1.6
 */
@Repository
public class FamilyMemberRepository extends BaseDAO<FamilyMemberEntity>{
	
	@Resource(name="templateCarrier")
    private JdbcTemplate jdbcTemplate;

    public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}
    
    public void saveFamilyMember(FamilyMemberEntity entity) throws Exception  {
    	entity.setCreateTime(DateUtil.getCurrentDate());
    	entity.setLastModifyTime(DateUtil.getCurrentDate());
		this.add(entity);
    }
    
    public void deleteFamilyMember(String userId,String mobile,String FamilyNetNum){
    	String sql = "delete from t_familynet where userId=? and mobile=? and FamilyNetNum=?";
    	this.delete(sql, new Object[]{userId,mobile,FamilyNetNum});
    }
    
    
    
}
